/**
 * Copyright 2010 The PlayN Tower Defense Authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package org.gtug.bishkek.towerdefense.core.tower;

import playn.core.CanvasLayer;
import playn.core.Game;
import playn.core.Image;

/**
 * Main Tower interface all towers in the game must implement this interface.
 * 
 * @TODO
 */
public interface Tower {

    /**
     * Tower layer dimensions
     */
    public final static float TOWER_WIDTH = 50.0f;
    public final static float TOWER_HEIGHT = 50.0f;

    /**
     * Get current tower layer width
     * 
     * @return Tower width
     */
    public float width();

    /**
     * Get current tower layer height
     * 
     * @return layer height
     */
    public float height();

    /**
     * Called once per game logic tick. Representation for {@link Game#update(float)} method.
     * Update current tower states.
     * 
     * @param alpha 
     */
    public void update(float delta);

    /**
     * Representation for {@link Game#paint(float)} method.
     * Draw tower on scene
     * 
     * @param alpha 
     */
    public void paint(float alpha);

    /**
     * Get current tower {@link Image} resource
     * 
     * @return tower image
     */
    public Image image();

    /**
     * Get current tower {@link CanvasLayer}
     * 
     * @return tower layer
     */
    public CanvasLayer layer();

    /**
     * Sets the translation of the tower layer.
     * <p>
     * This sets the translation of the tower layer's transformation matrix so coordinates in the layer will
     * be translated by this amount.
     *
     * @param x translation on x axis
     * @param y translation on y axis
     */
    public void translate(float x, float y);

    /**
     * Sets the translation of the tower layer center.
     * <p>
     * This sets the translation of the tower layer's center transformation matrix so coordinates in the layer center will
     * be translated by this amount.
     *
     * @param x translation on x axis
     * @param y translation on y axis
     */
    public void translateCenter(float x, float y);
}
